package maquinasam.sam;
import java.util.LinkedList;

public class RegistroActivacion {
	private LinkedList<Integer> localData;
	private byte returnAddress;
	// private Integer dynamicLink; -> NO es necesario ya que Java ya controla
	//								   esto con las LinkedList
	
	
	public RegistroActivacion(byte returnAddress) {
		this.localData = new LinkedList<Integer>();
		this.returnAddress = returnAddress;
	}	
	
	public LinkedList<Integer> getLocalData() {
		return localData;
	}

	public void setLocalData(LinkedList<Integer> localData) {
		this.localData = localData;
	}
	
	public void pushLocalData(Integer data) {
		this.localData.addLast(data);
	}
	
	public Integer popLocalData() {
		return this.localData.removeLast();
	}
	
	public byte getReturnAddress() {
		return returnAddress;
	}
	
	public void setReturnAddress(byte returnAddress) {
		this.returnAddress = returnAddress;
	}
	
	public String toString() {
		String cadena = "";
		cadena += "[ Return = " + this.getReturnAddress() + "{";
		for (int i = 0; i < localData.size(); i++)
			cadena += localData.get(i) + ",";
		cadena += "}]";
		return cadena;
	}

}
